/*
 * vbat电源电压检测――ADC
 */

#ifndef VBAT_H_
#define VBAT_H_

#include "driverlib\MSP430F5xx_6xx\driverlib.h"

#define VBAT_ADC12_PORT     GPIO_PORT_P6
#define VBAT_ADC12_PIN      GPIO_PIN4//p6.4
#define VBAT_ADC12_BASE     ADC12_A_BASE
#define VBAT_ADC12_MEMORY   ADC12_A_MEMORY_4
#define VBAT_ADC12_IFG      ADC12IFG4
#define VBAT_ADC12_INPUT    ADC12_A_INPUT_A4

void vbat_Init();

void vbat_GetElectricQuantity(uint16_t *electrQuan);

/*
 * @brief  获取电源电压
 * @param  v：当前的电源电压值会返回到这里，该值为整型，实际值=v/10.0
 * @retval 无*/
void vbat_GetVoltage(uint16_t *v);

#endif /* VBAT_H_ */
